package com.example.thirdhomework

import android.content.Intent
import android.os.Bundle
import androidx.activity.enableEdgeToEdge
import androidx.appcompat.app.AppCompatActivity
import androidx.core.view.ViewCompat
import androidx.core.view.WindowInsetsCompat
import com.example.thirdhomework.databinding.ActivityThirdBinding

class ThirdActivity : AppCompatActivity() {
    private val binding by lazy {
        ActivityThirdBinding.inflate(layoutInflater)
    }
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        enableEdgeToEdge()
        setContentView(binding.root)

        //
        binding.confirm.setOnClickListener{
            val intent = Intent()
            intent.putExtra(KEY2,binding.endText.text.toString())
            setResult(1,intent)//回调
            finish()//关闭页面

        }
    }
}